package com.example01;

public class SummationTest {
    public static void main(String[] args) {
        test(3,4);
    }
    private static void test(int a,int repeat) {
        int a1 = a;
        int end = 0;
        if(repeat < 0 || repeat >10) {
            System.out.println("error");
        }
        else {
            for (int i = 0; i < repeat; i++) {
                end = end + a1;
                a1 = a1 * 10 + a;
            }
            System.out.println(end);
        }
    }
}
